<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of spanel
 *
 * @author mini
 */
class Spanel extends CI_Controller {
    
    public function __construct() {
        parent::__construct();
        global $admin, $data;
        # cargamos variables
        $admin = $this->session->userdata('admin');
        $admin['place'] = 'xpanel';
        # verifica si pasó por home
        if ($admin['ta_tipo_administrador_id'] != 2) {
            redirect('home');
        }
        $this->output->enable_profiler(false);
    }

    public function index() {
        global $data, $admin;

        $this->load->view('template/header', $admin);
        $this->load->view('template/open_content_container');
        $this->load->view('menu/menu_resp', $data);
        $this->load->view('panel/cpanel_resp');
        $this->load->view('template/close_content_container');
        $this->load->view('template/footer');
    }

    public function logOut() {
        //termina session de ususario
        $this->session->sess_destroy();
        redirect(base_url());
    }
}
